package com.rongshe.hotel.service.impl;

import java.util.List;
import com.rongshe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rongshe.hotel.mapper.RsHotelMapper;
import com.rongshe.hotel.domain.RsHotel;
import com.rongshe.hotel.service.IRsHotelService;

/**
 * 民宿Service业务层处理
 * 
 * @author rongshe
 * @date 2025-02-17
 */
@Service
public class RsHotelServiceImpl implements IRsHotelService 
{
    @Autowired
    private RsHotelMapper rsHotelMapper;

    /**
     * 查询民宿
     * 
     * @param id 民宿主键
     * @return 民宿
     */
    @Override
    public RsHotel selectRsHotelById(Long id)
    {
        return rsHotelMapper.selectRsHotelById(id);
    }

    /**
     * 查询民宿列表
     * 
     * @param rsHotel 民宿
     * @return 民宿
     */
    @Override
    public List<RsHotel> selectRsHotelList(RsHotel rsHotel)
    {
        return rsHotelMapper.selectRsHotelList(rsHotel);
    }

    /**
     * 新增民宿
     * 
     * @param rsHotel 民宿
     * @return 结果
     */
    @Override
    public int insertRsHotel(RsHotel rsHotel)
    {
        rsHotel.setCreateTime(DateUtils.getNowDate());
        return rsHotelMapper.insertRsHotel(rsHotel);
    }

    /**
     * 修改民宿
     * 
     * @param rsHotel 民宿
     * @return 结果
     */
    @Override
    public int updateRsHotel(RsHotel rsHotel)
    {
        rsHotel.setUpdateTime(DateUtils.getNowDate());
        return rsHotelMapper.updateRsHotel(rsHotel);
    }

    /**
     * 批量删除民宿
     * 
     * @param ids 需要删除的民宿主键
     * @return 结果
     */
    @Override
    public int deleteRsHotelByIds(Long[] ids)
    {
        return rsHotelMapper.deleteRsHotelByIds(ids);
    }

    /**
     * 删除民宿信息
     * 
     * @param id 民宿主键
     * @return 结果
     */
    @Override
    public int deleteRsHotelById(Long id)
    {
        return rsHotelMapper.deleteRsHotelById(id);
    }
}
